import QtQuick 1.1
import com.meego 1.0
import "CommomUtil.js" as Util
import "Modulelib.js" as ModuleUtil

Page {
    id: dealer_cars_page

    tools: ModuleToolBar{}

    orientationLock : PageOrientation.LockPortrait


    TitleBar{
           id: dealer_cars_title
           anchors.top: dealer_cars_page.top; anchors.left: dealer_cars_page.left
           width: dealer_cars_page.width; height: 71
           titleName: ModuleUtil.current_dealer_name
    }


    property real latitude : 0

    property real longitude : 0

    property int zoom : 17

    property bool loadImage: mapImage.status === Image.Ready

    Image {
        id: mapImage
        anchors.fill: parent


    }

    Column
    {
        id: loadingView
        anchors.centerIn: parent

        Text{
            text: "loading map ..."
        }
    }

    BusyLoading{
        id: loading
        anchors.centerIn: parent
        visible: loadImage
    }

    Component.onCompleted: {
        loading.loading();
        loadMap();
    }

    function loadMap()
    {

        mapImage.visible = true;
        loadingView.visible = false;
        mapImage.source = ModuleUtil.getMapSourceUrl();
    }
}
